'use strict'

let nunjucks=require("nunjucks");

function creatEnv(path,opts) {
    path=path || 'views';
    opts=opts || {};

    let envOptions={
 
    }
    return nunjucks.configure(path,envOptions);
}

module.exports=async(ctx,next)=>{
    let env=creatEnv();
    ctx.render=function (views,model) {
        ctx.body=env.render(views,model);
    }
    await next();
}